package Work139;

/**
 * @Author admin
 * @Date 2019/3/19 13:47
 */
 class WZBank extends Bank {
    double year;

    public WZBank(){

    }
    public WZBank(int money,double rate,double year){
        super(money,rate);
        this.year=year;
    }

    @Override
    public double compulnterest() {
        super.year=(int)year;
        int day=(int)((year-super.year)*1000);
        double yearInter =super.compulnterest();
        double dayInter=day*money*0.0002;
        System.out.println("利息是"+(yearInter+dayInter)+"存了"+super.year+"年"+day+"天");
        return yearInter+dayInter;
    }
}
